package org.example.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName order_form
 */
@TableName(value ="order_form")
@Data
public class OrderForm implements Serializable {
    /**
     * 订单的id
     */
    @TableId
    private Integer oid;

    /**
     * 支付金额
     */
    @TableId
    private Integer paymentAmount;

    /**
     * 支付状态
     */
    private Integer stateOfPayment;

    /**
     * 
     */
    private Integer uid;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 执行时间
     */
    private Date timeOfPayment;

    /**
     * 
     */
    private Integer wid;


    public boolean isPut(){
        return this.getStateOfPayment() == 1;
    }
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        OrderForm other = (OrderForm) that;
        return (this.getOid() == null ? other.getOid() == null : this.getOid().equals(other.getOid()))
            && (this.getPaymentAmount() == null ? other.getPaymentAmount() == null : this.getPaymentAmount().equals(other.getPaymentAmount()))
            && (this.getStateOfPayment() == null ? other.getStateOfPayment() == null : this.getStateOfPayment().equals(other.getStateOfPayment()))
            && (this.getUid() == null ? other.getUid() == null : this.getUid().equals(other.getUid()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getTimeOfPayment() == null ? other.getTimeOfPayment() == null : this.getTimeOfPayment().equals(other.getTimeOfPayment()))
            && (this.getWid() == null ? other.getWid() == null : this.getWid().equals(other.getWid()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getOid() == null) ? 0 : getOid().hashCode());
        result = prime * result + ((getPaymentAmount() == null) ? 0 : getPaymentAmount().hashCode());
        result = prime * result + ((getStateOfPayment() == null) ? 0 : getStateOfPayment().hashCode());
        result = prime * result + ((getUid() == null) ? 0 : getUid().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getTimeOfPayment() == null) ? 0 : getTimeOfPayment().hashCode());
        result = prime * result + ((getWid() == null) ? 0 : getWid().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", oid=").append(oid);
        sb.append(", paymentAmount=").append(paymentAmount);
        sb.append(", stateOfPayment=").append(stateOfPayment);
        sb.append(", uid=").append(uid);
        sb.append(", createTime=").append(createTime);
        sb.append(", timeOfPayment=").append(timeOfPayment);
        sb.append(", wid=").append(wid);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}